<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Web_SQL</title>
</head>


<body>
	<script type="text/javascript">

	var db = window.openDatabase("chinaDay","1.0","doramart",20000);

	// if(db)
	// {
	// 	alert("数据库创建成功");
	// }

	db.transaction(function(tx){

		tx.executeSql("CREATE TABLE dora (id int UNIQUE, title TEXT)");
	});


	db.transaction(function(tx){

		tx.executeSql("insert into dora (title) values (?)",["HelloWord"]);
	});

	// db.transaction(function(tx){

	// 	tx.executeSql("delete from dora where id = 2");
	// });

	db.transaction(function(tx){

		tx.executeSql("select * from dora",[],function(tx,rs){

			for(var i=0;i<rs.rows.length;i++)
			{
				document.write(rs.rows.item(i)["title"]) + "<br>"
			}
		},function(e){});
	});
	</script>
</body>
</html>